<template>
    <h1>(管理员)用户理财明细</h1>

    <table class="table table-bordre" border="1">
        <thead>
            <tr>
                <th>用户登录账号</th>
                <th>理财产品名称</th>
                <th>年收益</th>
                <th>购买金额</th>
                <th>购买时间</th>
            </tr>
        </thead>

        <tbody>
            <tr v-for="item in ShowFinancing "  >
                <td>{{ item.UL_Name }}</td>
                <td>{{ item.F_Name }}</td>
                <td>{{ item.F_APY }}</td>
                <td>{{ item.UF_Money }}</td>
                <td>{{ item.UF_Date }}</td>
            </tr>
        </tbody>

    </table>
</template>

<script setup lang="ts">
import  { ref,onMounted } from 'vue';
import axios from 'axios';
import { useRoute} from 'vue-router';

const route = useRoute();
console.log(route.params.F_Id);

const ShowFinancing = ref([{
    UL_Name:'',
    F_Name:'',
    F_APY:'',
    UF_Money:'',
    UF_Date:''
}])

onMounted(() => {
    axios({
        url:'http://localhost:53279/api/Financing/ShowUserFinancing',
        method:'get',
        params:{
            Fid:route.params.F_Id
        }
    })
    .then(function(res){
        console.log(res.data);
        ShowFinancing.value = res.data;
    })
    .catch(function(err){
        console.log(err);
    })
})
</script>